#include "WMShatter.h"

namespace WMShatter
{
bool
IsSafeWM(HWND window, UINT msg, WPARAM wParam, LPARAM lParam) 
{
  bool result = true;
  switch (msg) 
  {
    // - UNSAFE MESSAGES
  case WM_TIMER:
    result = lParam == 0;
    break;
  };
  if (!result) 
  {

  }
  return result;
}

LRESULT
SafeDefWindowProc(HWND window, UINT msg, WPARAM wParam, LPARAM lParam) 
{
  if (IsSafeWM(window, msg, wParam, lParam))
    return DefWindowProc(window, msg, wParam, lParam);
  return 0;
}

LRESULT
SafeDispatchMessage(const MSG* msg) 
{
  if (IsSafeWM(msg->hwnd, msg->message, msg->wParam, msg->lParam))
    return DispatchMessage(msg);
  return 0;
}

}

